package com.glut.forum.controller;


import com.glut.forum.bean.entity.TbArticle;
import com.glut.forum.common.beans.ResultBean;
import com.glut.forum.service.ITbArticleService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 文章表 前端控制器
 * </p>
 *
 * @author jobob
 * @since 2021-09-02
 */
@Slf4j
@AllArgsConstructor
@RestController
@RequestMapping("/forum/article")
public class TbArticleController {

    private final ITbArticleService articleService;

    @GetMapping("/all")
    public ResultBean<List<TbArticle>> getAllArticle(Integer idx, Integer limit) {
        return new ResultBean<>(articleService.selectArticlePage(idx, limit));
    }
}
